<!DOCTYPE html>
<html>
<head>
    <title>Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script type="application/x-javascript">
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        }
    </script>
    <!--<meta name="keywords" content="Flat Dark Web Login Form Responsive Templates, Iphone Widget Template, Smartphone login forms,Login form, Widget Template, Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />-->
    <link href="__PUBLIC__/layui/css/style.css" rel='stylesheet' type='text/css'/>
</head>
<body>

<!--SIGN UP-->
<h1>商城后台登录</h1>
<div class="login-form">
    <div class="close"></div>
    <div class="head-info">
        <label class="lbl-1"> </label>
        <label class="lbl-2"> </label>
        <label class="lbl-3"> </label>
    </div>
    <div class="clear"></div>
    <div class="avtar">
        <img src="__PUBLIC__/layui/images/face/avtar.png"/>
    </div>
    <form action=" " method="post" onsubmit="return false;">
        <input type="text" class="text" name="username" value="" placeholder="请输入用户名">
        <input type="password" name="password" value="" placeholder="请输入密码"><span id="pwdmsg"></span>
        <div class="signin">
            <input type="submit" value="Login">
        </div>
    </form>
</div>
<div class="copy-rights">
    <p>Copyright &copy; 2017.Company name All rights reserved.</p>
</div>

</body>
<script src="__PUBLIC__/layui/layui.js"></script>
<script>
    layui.use('form', function () {
        var data = {};
        var $ = layui.jquery;
        $('form').submit(function () {
            data.username = $('input[name="username"]').val();
            data.password = $('input[name="password"]').val();
            $.post("{:U('Login/checkLogin')}", data, function (e) {
                if (e.code == 1) {
                    $('#pwdmsg').html('<img src="__PUBLIC__/layui/images/face/pass.png"/><p style="color: #aaa;">用户名或密码错误哦！</p>')
                } else {
                    window.location.href = "{:U('Index/index')}";
                }
            })
        })
    })
</script>
</html>